import React, { Component } from 'react';
import './App.css'
import List from './components/list';
import Search from './components/search';

class App extends Component {

  // 初始化状态
  state = {
    userArr:[],  // 用户信息列表
    isFirst:true,  // 是否为初次进入页面
    isLoading:false,  // 是否为加载状态
    err:'',  // 报错信息
  }

  // 更新状态回调
  updateAppState = (stateObj)=>{
    // 更新状态
    this.setState(stateObj)
  }

  render() {
    return (
      <div className='container'>
        <Search updateAppState={this.updateAppState}/>
        <List {...this.state}/>
      </div>
    );
  }
}

export default App;